#ifndef _EXECUTOR_H_
#define _EXECUTOR_H_

#define TAB		"\t"
#define EMPTY	""

#include "UserInterface.h"
#include "Task.h"
#include "Validator.h"
#include "Storage.h"
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <fstream>

using namespace std;

class Executor {
public:
	// These are the possible command types
	static enum COMMAND_TYPE {
		ADD, DELETE, SHOW, SEARCH, CLEAR, DONE, HELP, EXIT, INVALID
	};
	static enum KEYWORD_TYPE {
		DATE, STARTS, ENDS, DETAIL, IMPT
	};	

	static vector<Task*> taskList;

	//void loadVect();
	void loadVectToExecutor();
	void storeVectFromExecutor();

	COMMAND_TYPE determineCommandType(string commandTypeString);
	KEYWORD_TYPE determineKeywordType(string keywordTypeString);
	
	string toLowerCase(string word);
	
	string getFirstWord(string &inputLine);
	//string removeFirstWord(string &inputLine);
	string extractFirstWord(string &inputLine);
	
	string executeCommand(string &inputLine);
	
	string makeTask(string &inputLine, Task * &t);
	string executeAdd(string &inputLine);
	
	int makeInt(string taskNum_str);
	string executeDelete(string &inputLine);
	
	string executeInvalid(string &inputLine);
	
	string executeShow(string &inputLine);

	string executeSearch(string &inputLine);

	string executeClear(string &inputLine);
	
	//int makeInt(string taskNum_str);
	string executeDone(string &inputLine);

	string executeHelp();

	string executeExit();
};
#endif